/*	 
 *	commands.c
 *	the genie shell command part for ucosII
 *	under skyeye
 *
 *	Bugs report:	 Yang Ye  ( yangye@163.net )
 *	Last modified:	 2003-02-19 
 *  changed by: wenjia
 */


#include "includes.h"
#include "commands.h"

command ShellComms[MAX_COMMAND_NUM];

INT8U InitCommands()
{
	ShellComms[0].num = 0;
	ShellComms[0].name = "hello";
	ShellComms[0].CommandFunc = HelloFunc;

	ShellComms[1].num = 1;
	ShellComms[1].name = "hostname";
	ShellComms[1].CommandFunc = HostNameFunc;
	return 0;
}

INT8U HelloFunc(INT8U argc,char **argv)
{
	int i;
	OS_ENTER_CRITICAL();				
	printf("\n\rHello! I am genie");
	printf("\n\ryour argv is :");
	OS_ENTER_CRITICAL();
	if(argc>0){
	for(i=0;i<argc;i++){
		OS_ENTER_CRITICAL();
		printf("\n\r");
		printf(argv[i]);
		OS_ENTER_CRITICAL();
		}
  	}
	return 0;
}
		

INT8U HostNameFunc(INT8U argc,char **argv)
{
	OS_ENTER_CRITICAL();
	printf("\n\rHostname is genies");
	OS_ENTER_CRITICAL();
	return 0;
}
